package com.jzhao.jpre.model.dao;

import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Date;
import java.util.List;

import javax.sql.DataSource;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;

import com.jzhao.jpre.base.StringPublicDeal;
import com.jzhao.jpre.format.DataObjectMap;
import com.jzhao.jpre.format.DataObjectType;
import com.jzhao.jpre.model.PmsSearchPosbusino;

import org.springframework.jdbc.core.RowMapper;

	
public class PmsSearchPosbusinoDao
{
	protected JdbcTemplate jdbcTemplate;
	protected StringPublicDeal strPubDeal;
	

	public void setDataSource(DataSource dataSource) {
		jdbcTemplate = new JdbcTemplate(dataSource);
	}
	
	public void setStrPubDeal(StringPublicDeal strPubDeal) {
		this.strPubDeal = strPubDeal;
	} 
	/**
	 * @author liyj
	 * @param serialNo
	 * @return
	 * @2010-07-15
	 */
	public String searchBusino(String serialNo)
    {
            /*
			String sql="SELECT a.POSBUSINESSNO FROM PMS_MERCHANT_POS a,PMS_POS_INFO b"
				       +" WHERE POSSERIALNO='"+serialNo+"' AND b.ID=a.POSID";
			//System.out.println("sql:"+sql);*/
		    String sql="SELECT POSBUSINESSNO FROM PMS_MERCHANT_POS "
		       +" WHERE POSSERIALNO='"+serialNo+"'";

         return (String)jdbcTemplate.queryForObject(sql, java.lang.String.class);
	}
	/*
	public String searchBusino(String serialNo)
     {

			String sql="SELECT POSBUSINESSNO FROM PMS_MERCHANT_POS a,PMS_POS_INFO b"
				       +" WHERE POSSERIALNO='"+serialNo+"' AND b.ID=a.POSID";
			
         return (String)jdbcTemplate.queryForObject(sql, java.lang.String.class);
	}*/
}
